package com.study.mapper;

import com.study.bean.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentMapper {


    /*
            查询所有
     */
    @Select("SELECT * FROM student")
    public abstract List<Student> selectStudentAll();


    /*
       新增学生
     */
    @Insert("INSERT INTO student VALUES (#{number} , #{name},#{birthday},#{address}) ")
    void addStu(Student student);

    /*
           修改数据
     */
@Update("UPDATE student set number=#{number} ,name = #{name},birthday=#{birthday},address=#{address} where number = #{number}")
    void updateStu(Student student);

    /*
            删除数据
     */
    @Delete("DELETE FROM  student  WHERE  number=#{number}")
    void  deleteStu(String number);

}
